# -*- coding: utf-8 -*-
from common.helper import Helper
from db.mysql import MysqlClient
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "平安e生保"

    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):
            data["name"] = self.name
            data["company"] = "平安保险"
            data["year"] = item["year"]
            data["socialSec"] = "Y" if "有社保版" in item["plan"] else "N"
            data["generalMedical"] = item["generalMedical"]
            data["seriousMedical"] = item["seriousMedical"]
            data["expire"] = item["expire"]
            data["payType"] = "年缴"
            data["price"] = item["price"]
            Helper.mergeTable(self.name, self.mysql, data)